﻿using System;
namespace ElingOA6_Admin_DSJCJ.Model
{
    /// <summary>
    /// 上班时间定义
    /// </summary>
    [Serializable]
    public partial class WorkTime
    {
        public WorkTime()
        { }
        #region Model
        private decimal _fworktimeid;
        private string _fentityno;
        private DateTime _fbegindate;
        private DateTime _fenddate;
        private DateTime _fambegintime;
        private DateTime _famendtime;
        private DateTime _fpmbegintime;
        private DateTime _fpmendtime;
        /// <summary>
        /// 上班时间ID
        /// </summary>
        public decimal FWorkTimeID
        {
            set { _fworktimeid = value; }
            get { return _fworktimeid; }
        }
        /// <summary>
        /// 公司编码
        /// </summary>
        public string FEntityNo
        {
            set { _fentityno = value; }
            get { return _fentityno; }
        }
        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime FBeginDate
        {
            set { _fbegindate = value; }
            get { return _fbegindate; }
        }
        /// <summary>
        /// 结束日期
        /// </summary>
        public DateTime FEndDate
        {
            set { _fenddate = value; }
            get { return _fenddate; }
        }
        
        /// <summary>
        /// 上午上班时间
        /// </summary>
        public DateTime FAMBeginTime
        {
            set { _fambegintime = value; }
            get { return _fambegintime; }
        }
        /// <summary>
        /// 上午下班时间
        /// </summary>
        public DateTime FAMEndTime
        {
            set { _famendtime = value; }
            get { return _famendtime; }
        }
        /// <summary>
        /// 下午上班时间
        /// </summary>
        public DateTime FPMBeginTime
        {
            set { _fpmbegintime = value; }
            get { return _fpmbegintime; }
        }
        /// <summary>
        /// 下午下班时间
        /// </summary>
        public DateTime FPMEndTime
        {
            set { _fpmendtime = value; }
            get { return _fpmendtime; }
        }
        #endregion Model


        #region 字段初始化
        /// <summary>
        /// 开始日期
        /// </summary>
        public string FBeginDateStr
        {
            get { return _fbegindate.ToString("yyyy-MM-dd"); }
        }
        /// <summary>
        /// 结束日期
        /// </summary>
        public string FEndDateStr
        {
            get { return _fenddate.ToString("yyyy-MM-dd"); }
        }

        /// <summary>
        /// 上午上班时间
        /// </summary>
        public string FAMBeginTimeStr
        {
            get { return _fambegintime.ToString("HH:mm"); }
        }
        /// <summary>
        /// 上午下班时间
        /// </summary>
        public string FAMEndTimeStr
        {
            get { return _famendtime.ToString("HH:mm"); }
        }
        /// <summary>
        /// 下午上班时间
        /// </summary>
        public string FPMBeginTimeStr
        {
            get { return _fpmbegintime.ToString("HH:mm"); }
        }
        /// <summary>
        /// 下午下班时间
        /// </summary>
        public string FPMEndTimeStr
        {
            get { return _fpmendtime.ToString("HH:mm"); }
        }
#endregion
        #region 增加

        /// <summary>
        /// 上午上班考勤时间
        /// </summary>
        private DateTime famattendancetime;
        /// <summary>
		/// 上午上班考勤时间
		/// </summary>
		public DateTime FAMAttendanceTime
		{
            set { famattendancetime = value; }
            get { return famattendancetime; }
		}
        /// <summary>
        /// 下午下班考勤时间
        /// </summary>
        private DateTime fpmattendancetime;
		/// <summary>
		/// 下午下班考勤时间
		/// </summary>
		public DateTime FPMAttendanceTime
		{
            set { fpmattendancetime = value; }
            get { return fpmattendancetime; }
		}
		/// <summary>
		/// 是否修正
        ///Y- 是
        ///N-否
		/// </summary>
		public string FIsModify
		{
			set;
			get;
		}
        /// <summary>
        /// 格式化后的上午上班考勤时间字符串
        /// </summary>
        public string FAMAttendanceTimeStr
        {
            get
            {
                if (famattendancetime.ToString() == "")
                {
                    return famattendancetime.ToString();
                }
                else
                {
                    return DateTime.Parse(famattendancetime.ToString()).ToString("HH:mm");
                }
            }
        }
        /// <summary>
        /// 格式化后的上午上班考勤时间字符串
        /// </summary>
        public string FPMAttendanceTimeStr
        {
            get
            {
                if (fpmattendancetime.ToString() == "")
                {
                    return fpmattendancetime.ToString();
                }
                else
                {
                    return DateTime.Parse(fpmattendancetime.ToString()).ToString("HH:mm");
                }
            }
        }
        #endregion
    }
}

